package com.scs.application.core.pdf.enums;

import lombok.Getter;

/**
 * @description: PDF 页面方向
 */
public enum PdfPageDirection {
    TRANSVERSE("transverse", "横向"),
    LONGITUDINAL("longitudinal", "纵向");


    @Getter
    private String code;

    @Getter
    private String desc;

    PdfPageDirection(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static PdfPageDirection of(String code) {
        String lowerCase = code.toLowerCase();
        switch (lowerCase) {
            case "longitudinal":
                return PdfPageDirection.LONGITUDINAL;
            case "transverse":
                return PdfPageDirection.TRANSVERSE;
            default:
                return PdfPageDirection.LONGITUDINAL;
        }
    }
}
